CLS RANDOMIZE TIMER Z$ = " " Q = 0 P = 0 LOCATE 2, 24: PRINT "CLOSEST TO 31 BUT NOT OVER WINS." LOCATE 6, 28: PRINT "YOU" LOCATE 6, 48: PRINT "ME" DO LOCATE 7, 28: PRINT P LOCATE 17, 29: PRINT "DO YOU WISH A NUMBER?" LOCATE 19, 34: PRINT "TYPE Y OR N." DO LET a$ = INKEY$ IF a$ = CHR$(27) THEN END LOOP UNTIL UCASE$(a$) = "N" OR UCASE$(a$) = "Y" IF UCASE$(a$) = "N" THEN EXIT DO LOCATE 17, 29: PRINT Z$ LOCATE 19, 34: PRINT Z$ C = INT(RND * 11) + 1 P = P + C LOCATE 17, 32: PRINT "YOUR NUMBER IS "; C LOOP DO C = INT(RND * 11) + 1 LOCATE 17, 29: PRINT Z$ LOCATE 19, 34: PRINT Z$ LOCATE 17, 33: PRINT "MY NUMBER IS "; C Q = Q + C LOCATE 7, 47: PRINT Q LOOP UNTIL Q > 24 IF (Q > P AND Q < 32) OR (Q < 32 AND P > 31) THEN LOCATE 17, 33: PRINT " I WIN. " IF (Q < P AND P < 32) OR (Q > 31 AND P < 32) THEN LOCATE 17, 33: PRINT " YOU WIN. " IF Q = P OR (P > 31 AND Q > 31) THEN LOCATE 17, 33: PRINT " WE TIED. " LOCATE 19, 27: PRINT "PRESS ENTER TO PLAY AGAIN." SLEEP 0 CLS RUN